package com.my.cd.proxy;

import java.rmi.Naming;

/**
 * 主测试类
 */
public class MainTest {
    public static void main(String[] args) {
        Monitor monitor = new Monitor();
        try {
            CandyMachineRemote candyMachine = (CandyMachineRemote) Naming.lookup("rmi://127.0.0.1:6602/test1");
            monitor.addMachine(candyMachine);
            candyMachine = (CandyMachineRemote) Naming.lookup("rmi://127.0.0.1:6602/test2");
            monitor.addMachine(candyMachine);
        } catch (Exception e) {
            e.printStackTrace();
        }
        monitor.report();
    }
}
